package pages

import (
	"github.com/templui/templui/internal/ui/layouts"
	"github.com/templui/templui/internal/ui/modules"
	"github.com/templui/templui/internal/ui/showcase"
)

templ Separator() {
	@layouts.DocsLayout(
		"Separator",
		"Visual divider that separates content with an optional label.",
		[]modules.TableOfContentsItem{
			{
				ID:   "installation",
				Text: "Installation",
			},
			{
				Text: "Examples",
				ID:   "examples",
				Children: []modules.TableOfContentsItem{
					{
						Text: "Vertical",
						ID:   "vertical",
					},
					{
						Text: "With Label",
						ID:   "with-label",
					},
					{
						Text: "Decorated",
						ID:   "decorated",
					},
				},
			},
			{
				ID:   "api",
				Text: "API Reference",
				Children: []modules.TableOfContentsItem{
					{
						ID:   "separator",
						Text: "Separator",
					},
				},
			},
		},
	) {
		@modules.PageWrapper(modules.PageWrapperProps{
			Name:        "Separator",
			Description: templ.Raw("Visual divider that separates content with an optional label."),
			Tailwind:    true,
			Breadcrumbs: modules.Breadcrumbs{
				Items: []modules.BreadcrumbItem{
					{
						Text: "Docs",
						Path: "/docs",
					},
					{
						Text: "Components",
						Path: "/docs/components",
					},
					{
						Text: "Separator",
					},
				},
			},
		}) {
			@modules.ExampleWrapper(modules.ExampleWrapperProps{
				ShowcaseFile:    showcase.SeparatorDefault(),
				PreviewCodeFile: "separator_default.templ",
			})
			@modules.ContainerWrapper(modules.ContainerWrapperProps{
				Title: "Installation",
				ID:    "installation",
			}) {
				@modules.ComponentUsage(modules.ComponentUsageProps{
					ComponentName: "separator",
				})
			}
			@modules.ContainerWrapper(modules.ContainerWrapperProps{
				Title: "Examples",
				ID:    "examples",
			}) {
				@modules.ExampleWrapper(modules.ExampleWrapperProps{
					SectionName:     "Vertical",
					ShowcaseFile:    showcase.SeparatorVertical(),
					PreviewCodeFile: "separator_vertical.templ",
					ID:              "vertical",
				})
				@modules.ExampleWrapper(modules.ExampleWrapperProps{
					SectionName:     "With Label",
					ShowcaseFile:    showcase.SeparatorLabel(),
					PreviewCodeFile: "separator_label.templ",
					ID:              "with-label",
				})
				@modules.ExampleWrapper(modules.ExampleWrapperProps{
					SectionName:     "Decorated",
					ShowcaseFile:    showcase.SeparatorDecorated(),
					PreviewCodeFile: "separator_decorated.templ",
					ID:              "decorated",
				})
			}
			@modules.ContainerWrapper(modules.ContainerWrapperProps{
				Title: "API Reference",
				ID:    "api",
			}) {
				@modules.APILegend()
				<div id="separator" class="mb-8">
					@modules.APITable(modules.APITableProps{
						Title:       "Separator",
						Description: "Visual divider component for separating content sections with optional labeling.",
						Items: []modules.APITableItem{
							{
								Name:        "ID",
								Type:        "string",
								Default:     "",
								Description: "Unique identifier for the separator element.",
								Required:    false,
							},
							{
								Name:        "Class",
								Type:        "string",
								Default:     "",
								Description: "Additional CSS classes to apply to the separator.",
								Required:    false,
							},
							{
								Name:        "Attributes",
								Type:        "templ.Attributes",
								Default:     "",
								Description: "Additional HTML attributes to apply to the separator element.",
								Required:    false,
							},
							{
								Name:        "Orientation",
								Type:        "Orientation",
								Default:     "horizontal",
								Description: "Orientation of the separator. Options: 'horizontal', 'vertical'.",
								Required:    false,
							},
							{
								Name:        "Decoration",
								Type:        "Decoration",
								Default:     "none",
								Description: "Decoration style for the separator. Options: 'none', 'dashed', 'dotted'.",
								Required:    false,
							},
						},
					})
				</div>
			}
		}
	}
}
